5. Security Commands > 5.3 AT^SPIC   Display PIN counter

5.3
AT^SPIC   Display PIN counter
The AT^SPIC command can be used to find out whether the ME is waiting for a password and, if so, how many attempts are left to enter the password.

The execute command returns the number of attempts still available for entering the currently required password, for example the PIN, PUK, PH-SIM PUK etc.

The read command AT^SPIC? indicates which password the number of attempts stated by the execute com­mand actually refers to. Also, the write command may be used to query the counter for a specific password: It indicates the number of attempts still available for entering the password identified by <facility>, for example the PIN, PIN2, PH-SIM PIN etc.

To check whether or not you need to enter a password use the read commands AT+CPIN?, AT+CPIN2? and AT^SPIC?. If the response to AT+CPIN? is "READY" the counter of the execute command AT^SPIC relates to PIN2. See last example. If the responses to AT+CPIN? and AT+CPIN2? both read "READY", no password is currently required, and the referrer of the execute command AT^SPIC is explicitly undefined.
Syntax
Test Command  
Response(s)
Read Command  
Response(s)
Exec Command  
Response(s)
Write Command  
Response(s)
Reference(s) 
PIN 
ASC0 
ASC1 
USB 
MUX1 
MUX2 
MUX3 
Charge 
Last 

Parameter Description
 
Number of attempts left to enter the currently required password. This number will be counted down after each failure.
 
Password for which the corresponding PIN counter is to be displayed.
“SC“
SIM PIN or SIM PUK. If the SIM PIN has been deactivated after three failed attempts, the counter for SIM PUK will be returned instead.
“PS“
"Phone code" or "device code" (cf. AT+CLCK and AT+CPWD). If incorrectly entered three times, the Master Phone Code is required to lift the lock and the number of remaining attempts for the master phonecode will be returned.
“P2“
SIM PIN2 or SIM PUK2. If the SIM PIN2 has been deactivated after three failed attempts, the counter for SIM PUK2 will be returned instead.
“PN“
Network Personalisation
 
<code>(text)
Identification of the currently required password.
SIM PIN
ME is waiting for SIM PIN1.
SIM PUK
ME is waiting for SIM PUK1 if PIN1 was disabled after three failed attempts to enter PIN1.
SIM PIN2
ME is waiting for PIN2, when the attempt to access PIN2 requiring features was acknowledged with +CME ERROR:17 (e.g. if the user attempts to edit the FD phonebook).
SIM PUK2
ME is waiting for PUK2 to unblock a disabled PIN2. Necessary if preceding command was acknowledged with +CME ERROR:18.
PH-SIM PIN
ME is waiting for phone-to-SIM card password if ''PS'' lock is active and user inserts other SIM card than the one used for the lock. (''PS'' lock is also referred to as phone or antitheft lock).
PH-SIM PUK
ME is waiting for Master Phone Code, if the above ''PS'' lock password was incorrectly entered three times.
PH-NET PUK
ME is waiting for network personalisation unblocking password


Notes
•
Whenever the required password changes, <counter> changes to reflect that change. Please refer to the examples below.
•
For passwords associated to the phone lock (''PS'' lock set by user or factory) or other factory set locks, such as ''PF'', ''PN'', ''PU'', ''PP'', ''PC'' the number of attempts is subject to a timing algorithm explained in AT+CPIN. If these passwords are incorrectly entered the counter first returns 3, 2 and 1 remaining attempt(s), but then gives the total number of attempts which amounts to 63 (see example below).
•
See also Chapters AT+CLCK, AT+CPIN, AT+CPIN2, AT+CPWD, AT^SLCK for further information on locks and passwords.

Examples

EXAMPLE 1


The user fails to provide a correct SIM PIN three times. The counter decreases each time. After the counter reaches zero, the SIM PUK is required. After each failure to enter a correct SIM PUK, the counter decreases.
 
EXAMPLE 2


Though a mobile is locked to a specific SIM card (phone lock), the user attempts to operate it with another SIM card. The user correctly enters the SIM PIN of the SIM card currently inserted, but then fails to give the ''PS'' lock password (PH-SIM PUK):
 
EXAMPLE 3


This example shows that after successful SIM PIN1 authentication the counter of the AT^SPIC execute and read command refers to SIM PIN2, i.e. it does not reflect the status of SIM PIN1. This may be a problem if the user enters a wrong PIN1 and is not aware that the number of attempts left to enter SIM PIN1 is counted down.
 
The AT+CPIN? read command confirms that SIM PIN1 authentication was successful.
As SIM PIN1 authentication was successful, the counter relates to SIM PIN2 and correctly indicates that the user has 3 attempts to enter SIM PIN2.
This time, after the SIM PIN1 code has been dis­abled, the counter indicates the status of SIM PIN1 and notifies that 10 attempts are left to enter the SIM PUK.
To avoid conflicts we recommend to use the AT^SPIC read and write commands rather than the execute com­mand only. The read command clearly states the currently required password, and the write command may be used to get the counter for a specific <facility>, in this case for example "P2".